package com.island.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.island.model.User;
import com.pollexsoft.base.dao.BaseHibernateDao;

@Repository
public class UserDao extends  BaseHibernateDao<User, java.lang.String> {

	/**
	 * 查询全部用户
	 * @return
	 */
	public List<User> findAll(){
		return find("from User", new Object[]{});
	}
	
	/**
	 * 新建一个用户
	 * @param User
	 */
	public void insertUser(User user){
		this.insert(user);
	}
	
	/**
	 * 根据ID删除
	 * @param id
	 */
	public void delUser(int id){
		this.delete("delete from User where userID=?", id);
	}
	
	/**
	 * 修改用户信息
	 * @param User
	 */
	public void updateUser(User user){
		this.update(user);
	}
}
